package com.codeoss.framework.view.parser;

import org.springframework.stereotype.Service;

import com.codeoss.framework.view.component.Component;
import com.codeoss.framework.view.component.WebSocketComponent;
import com.fasterxml.jackson.databind.node.ObjectNode;

@Service("websocketParser")
public class WebSocketParser extends AbstractComponentParser {
	@Override
	 protected void setAttributes(IParseContext parseContext, ObjectNode objectNode,Component component) {
		super.setAttributes(parseContext, objectNode, component);
		WebSocketComponent webSocketComponent=(WebSocketComponent)component;
		String connectionString=objectNode.get("connectionString").asText();
		webSocketComponent.setConnectionString(connectionString);
	 }
	 
	@Override
	protected Component createComponent(IParseContext parseContext, ObjectNode objectNode) {
		// TODO Auto-generated method stub
		return new WebSocketComponent();
	}

}
